package com.liu.controller;

import com.liu.entity.ServeBeauty;
import com.liu.service.intf.ServeBeautyService;
import com.liu.vo.PageBeanJson;
import com.liu.vo.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/serveBeauty/")
public class ServeBeautyController {
    @Autowired
    private ServeBeautyService serveBeautyService;
    @GetMapping("list.do")
    public PageBeanJson<ServeBeauty> list(int page,@RequestParam("limit")int pageSize){
        return serveBeautyService.list(page,pageSize);
    }
//    搜索
    @GetMapping("search.do")
    public PageBeanJson<ServeBeauty> search(ServeBeauty serveBeauty,int page,@RequestParam("limit") int pageSize){
        System.out.println(serveBeauty+"--------------");
        return serveBeautyService.search(serveBeauty,page,pageSize);
    }
    //新增
    @PostMapping("insert.do")
    public R insert(ServeBeauty serveBeauty){
        return serveBeautyService.insert(serveBeauty);
    }
    @PostMapping("update.do")
    public R update(ServeBeauty serveBeauty){
        return serveBeautyService.update(serveBeauty);
    }
    @PostMapping("del.do")
    public R delete(int id){
        return serveBeautyService.delete(id);
    }
    @PostMapping("delBatch.do")
    public R deleteBatch(@RequestBody int[] ids){
        return serveBeautyService.deleteBatch(ids);
    }
}
